home *** CD-ROM | disk | FTP | other *** search
/ Remix Doll 3: Dirty Sally / Remix Doll 3: Dirty Sally.iso / drtyslly.exe / MAIN_FNL.DXR / 04953_TCkrchLayer.ls < prev    next >
Encoding:
Text File  |  1995-02-11  |  4.4 KB  |  188 lines

  1. property ancestor, fBazooka, fBomb, fTapeLabel, fLastDeadTicks
  2. global kNumRooms, kRoomNames, kNumGirlsInRoom, kAlignCursNum, gNavigator, gTapes
  3.  
  4. on birth me
  5.   set ancestor to NewObj("TLayer")
  6.   mICkrchLayer(me)
  7.   return me
  8. end
  9.  
  10. on mICkrchLayer me
  11.   mIBkgnd(me)
  12.   mIBazooka(me)
  13.   mIBomb(me)
  14.   mITapeLabel(me)
  15.   mICkrch(me)
  16.   mICkrchPreload(me)
  17. end
  18.  
  19. on mIBkgnd me
  20.   set aSpr to 3
  21.   set aBkgnd to mNewView(me, "TMyView", aSpr, "bkgnd")
  22.   set aCursL to [531, 532]
  23.   set the cursor of sprite 3 to aCursL
  24. end
  25.  
  26. on mIBazooka me
  27.   set aSpr to 12
  28.   set fBazooka to mNewView(me, "TBazooka", aSpr, "Bazooka")
  29. end
  30.  
  31. on mIBomb me
  32.   set aSpr to 11
  33.   set fBomb to mNewView(me, "TAnim", aSpr, "Bomb")
  34.   mStAnimNumBgnEnd(fBomb, the number of cast "bomb", the number of cast "bombE")
  35.   mStLoop(fBomb, 0)
  36.   mOffStage(fBomb)
  37. end
  38.  
  39. on mITapeLabel me
  40.   set aSpr to 10
  41.   set fTapeLabel to mNewView(me, "TMyView", aSpr, "label")
  42.   mPuppetOn(fTapeLabel)
  43.   mOffStage(fTapeLabel)
  44. end
  45.  
  46. on mICkrch me
  47.   set aCurRoomName to mGtCurRoomName(gNavigator)
  48.   set aSpr to 6
  49.   repeat with aCkrchCount = 1 to kNumGirlsInRoom
  50.     if not mIsDeadCkrch(gTapes, aCurRoomName, aCkrchCount) then
  51.       set aCkrch to mNewView(me, "TCkrch", aSpr + aCkrchCount - 1, "Ckrch" & aCkrchCount)
  52.       set aCursL to [531, 532]
  53.       set the cursor of sprite (aSpr + aCkrchCount - 1) to aCursL
  54.     end if
  55.   end repeat
  56.   updateStage()
  57.   set fLastDeadTicks to the ticks
  58. end
  59.  
  60. on mICkrchPreload me
  61.   unLoadCast(the number of cast "kitchen", the number of cast "livingRoom")
  62.   preLoadCast(the number of cast "bazooka", the number of cast "bazookaE")
  63.   preLoadCast(the number of cast "bomb", the number of cast "bombE")
  64.   preLoadCast(the number of cast "cockroach", the number of cast "cockroachE")
  65. end
  66.  
  67. on mDeath me
  68.   stpSnd(2)
  69.   mDeath(ancestor)
  70. end
  71.  
  72. on mReqBorn me, vCkrch
  73.   mBorn(vCkrch)
  74. end
  75.  
  76. on mHitCkrch me, vCkrch
  77.   if not mCanFire(me) then
  78.     exit
  79.   end if
  80.   busyCurs()
  81.   mKill(vCkrch)
  82.   mFireAnim(me, mGtLocV(vCkrch), "hitSnd")
  83.   wait(45)
  84.   mMorphAnim(me, vCkrch)
  85.   set aCkrchNum to integer(the last char in mGtID(vCkrch))
  86.   mHitCkrch(gTapes, mGtCurRoomName(gNavigator), aCkrchNum)
  87.   mExamineComplete(me)
  88.   set fLastDeadTicks to the ticks
  89.   resetCurs()
  90.   if the optionDown then
  91.     set aAllDoneMessenger to NewObj("TAllDoneMessenger")
  92.     mAddMessenger(gApp, aAllDoneMessenger)
  93.   end if
  94. end
  95.  
  96. on mExamineComplete me
  97.   set aAllComplete to 1
  98.   repeat with aRoomCount = 1 to kNumRooms
  99.     set aRoomName to getAt(kRoomNames, aRoomCount)
  100.     set aRoomComplete to 1
  101.     repeat with aCkrchCount = 1 to kNumGirlsInRoom
  102.       if not mIsDeadCkrch(gTapes, aRoomName, aCkrchCount) then
  103.         set aRoomComplete to 0
  104.         exit repeat
  105.       end if
  106.     end repeat
  107.     if aRoomComplete = 0 then
  108.       set aAllComplete to 0
  109.       next repeat
  110.     end if
  111.     mCompleteRoom(gNavigator, aRoomName)
  112.   end repeat
  113.   if aAllComplete = 1 then
  114.     set aAllDoneMessenger to NewObj("TAllDoneMessenger")
  115.     mAddMessenger(gApp, aAllDoneMessenger)
  116.   end if
  117. end
  118.  
  119. on mFireBazooka me
  120.   if not mCanFire(me) then
  121.     exit
  122.   end if
  123.   busyCurs()
  124.   mFireAnim(me, the mouseV, "hitSnd")
  125.   puppetSound("lostSnd")
  126.   set fLastDeadTicks to the ticks
  127.   resetCurs()
  128. end
  129.  
  130. on mCanFire me
  131.   if (the ticks - fLastDeadTicks) < 15 then
  132.     return 0
  133.   else
  134.     return 1
  135.   end if
  136. end
  137.  
  138. on mFireAnim me, vHitLocV, vHitSndName
  139.   mOnStageAt(fBomb, mGtLocH(fBazooka), mGtLocV(fBazooka) - 100)
  140.   puppetSound("bazookaFireSnd")
  141.   repeat while mGtLocV(fBomb) > vHitLocV
  142.     mStLocV(fBomb, mGtLocV(fBomb) - 10)
  143.     mStAnimFrmNxt(fBazooka)
  144.     updateStage()
  145.     wait(2)
  146.   end repeat
  147.   mStAnimFrmFirst(fBazooka)
  148.   puppetSound(vHitSndName)
  149.   repeat with aBangCount = 1 to mGtNumAnimFrm(fBomb)
  150.     mStAnimFrmNxt(fBomb)
  151.     wait(3)
  152.     updateStage()
  153.   end repeat
  154.   mOffStage(vCkrch)
  155.   mOffStage(fBomb)
  156.   mStAnimFrmFirst(fBomb)
  157.   updateStage()
  158. end
  159.  
  160. on mMorphAnim me, vCkrch
  161.   mStLocH(vCkrch, 320)
  162.   mStLocV(vCkrch, 240)
  163.   mStAnimGrp(vCkrch, 2)
  164.   mStAnimFrmFirst(vCkrch)
  165.   puppetTransition(51)
  166.   updateStage()
  167.   wait(60)
  168.   repeat with aMorphCount = 2 to mGtNumAnimFrm(vCkrch)
  169.     mStAnimFrmNxt(vCkrch)
  170.     wait(10)
  171.     updateStage()
  172.   end repeat
  173.   set aCkrchNum to integer(the last char in mGtID(vCkrch))
  174.   set aRoomNum to mGtCurRoomNum(gNavigator)
  175.   mStCastNum(fTapeLabel, the number of cast (aCkrchNum & aRoomNum & "prv"))
  176.   mOnStageAt(fTapeLabel, 320, 244)
  177.   updateStage()
  178.   repeat while not (the mouseDown)
  179.     nothing()
  180.   end repeat
  181.   mOffStage(vCkrch)
  182.   mOffStage(fTapeLabel)
  183.   puppetTransition(51)
  184.   mStAnimGrp(vCkrch, 1)
  185.   mStAnimFrmFirst(vCkrch)
  186.   updateStage()
  187. end
  188.